package factoryNCastle;

import constants.*;

import interfaces.impl.Agent;
import interfaces.impl.agents.AgentDrawLife;
import interfaces.impl.agents.AgentMove;
import interfaces.impl.agents.AgentNormalMove;

import java.util.ArrayList;

import agents.AgentAttackClosestObject;
import agents.interaction.InteractionGenerateMonster;

import objects.WorldObject;

public final class AgentSingleton {
	
	private static AgentSingleton instace = new AgentSingleton();
	
	private AgentNormalMove agentNormalMove;
	private AgentDrawLife agentDrawLife;
	
	private AgentMove agentMove;
	private AgentAttackClosestObject agentAttackClosestObject;
	
	
	public static ArrayList<Agent> listAgents;
	
	
	private AgentSingleton(){
	
		listAgents=new ArrayList<Agent>();
		
		agentDrawLife = new AgentDrawLife();
		listAgents.add(agentDrawLife);
		
		agentNormalMove= new AgentNormalMove();
		listAgents.add(agentNormalMove);
		
	
		
		agentMove = new AgentMove();
		listAgents.add(agentMove);
		
		agentAttackClosestObject = new AgentAttackClosestObject();
		listAgents.add(agentAttackClosestObject);
		
	
	}
	
	public static void setAgent(WorldObject obj,int agentId){
		
		switch(agentId){
		case Constants.AGENT_DRAW_LIFE:
			obj.addAgent(new AgentDrawLife());
		break;
		case Constants.AGENT_NORMAL_MOVE:
			obj.addAgent(new AgentNormalMove());
			break;
		
		case Constants.AGENT_MOVE:
			obj.addAgent(new AgentMove());
			break;
		case Constants.AGENT_ATTACK_CLOSEST_OBJECT:
			obj.addAgent(new AgentAttackClosestObject());
			break;
		case Constants.AGENT_HUMAN_INTERACTION_GENERATE_MONSTER:
			obj.addHumanInteraction(new InteractionGenerateMonster());
			break;
			
		}
	}

}
